using System.Collections.Generic;
using UnityEngine;

public class ConnectionSpeedIndicatorController : MonoBehaviour
{
	public UILabel speedLabel;

	public List<UISprite> bars = new List<UISprite>();

	public Color defaultColour;

	public void SetSpeedDisplay(ConnectionSpeedIndicatorConfig.ConnectionSpeedRange speed)
	{
		UITools.ChangeText(speedLabel, string.Empty + speed.name);
		for (int i = 0; i < bars.Count; i++)
		{
			bars[i].color = ((i >= speed.numberOfShadedBars) ? defaultColour : speed.colour);
		}
	}
}
